<?php
/* Description: This file is used to add sub sub category. */
#########IncludeFiles####################################################################################
include_once '../inc/config.php';
include_once("../inc/bootstrape.php");
require_once _SITE_PATH_.'classes/Vendor/Vendor.php';
require_once _SITE_PATH_.'classes/Master/Master.php';
require_once _SITE_PATH_.'classes/CommonUtility/CommonUtility.php';

$id = trim($_REQUEST['id']);

if( $_POST['submit']=='Submit'){   
	$parms['id'] = $_POST['id'];
	$parms['country_id'] = $_POST['country_id'];
	$parms['name'] = $_POST['name'];
	 
	$condition['id'] = $parms['id'];
	
    if( CommonUtility::updateData($parms, 'state_master', $condition)) {        
        header("Location: state_mng.php?msg=1416");            
        exit;
    }
    $err = 1417;    
}

$states = array();
$states = Master::getStatesList($id);
$result = $states[0];

$dropdown_countries = array();
$dropdown_countries = CommonUtility::getCountry($result['country_id']);

$errMsg = $err;
$_tplName = 'master/state_edit.tpl';
$_title = 'Edit State';

require_once _ADMIN_TPL_MAIN_;
?>